package com.example.smart_community.mapper;

import com.example.smart_community.po.Household;
import com.example.smart_community.po.Houseinfo;
import com.example.smart_community.po.Staff;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface HouseholdMapper {
    @Select("select * from household")
    @Results({
            @Result(property = "hoId",column = "ho_id"),
            @Result(property = "hId",column = "h_id"),
            @Result(
                    property ="houseinfo" ,column ="h_id",
                    javaType= Houseinfo.class,
                    one=@One(select ="com.example.smart_community.mapper.HouseinfoMapper.selectById")
            )
    })
    List<Household> selectAll();
}
